{include file="header.htm" /}
<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    {include file="bar.htm" /}
    
    <!-- 数据表格区域 -->
    <div class="flexigrid">
        <!-- 工具栏 -->
        <div class="mDiv">
            <div class="ftitle">
                <div class="fbutton">
                    <a href="javascript:void(0);" data-href="{:weapp_url('Monkmenu/Monkmenu/add')}" 
                       onclick="openFullframe(this, '新增数据');">
                        <div class="add">
                            <span><i class="layui-icon layui-icon-addition"></i>新增数据</span>
                        </div>
                    </a>
                </div>
            </div>
            <!-- 搜索表单 -->
            <form class="navbar-form form-inline" action="{:weapp_url('Monkmenu/Monkmenu/index')}" 
                  method="get" onsubmit="layer_loading('正在处理');">
                {$searchform.hidden|default=''}
                <div class="sDiv">
                    <div class="sDiv2">
                        <select name="position" class="select" style="margin:0px 5px;">
                            <option value="">默认全部</option>
                        </select>
                    </div>
                    <div class="sDiv2">
                        <input type="text" size="30" name="keywords" class="qsbox" 
                               placeholder="搜索相关数据..." value="{$keywords|default=''}">
                        <input type="submit" class="btn" value="搜索">
                        <i class="fa fa-search"></i>
                    </div>
                </div>
            </form>
        </div>
        
        <!-- 表头 -->
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                    <tr>
                        <th class="sign w40">
                            <div class="tc"><input type="checkbox" autocomplete="off" class="checkAll"></div>
                        </th>
                        <th class="w40"><div class="tc">ID</div></th>
                        <th class="w250"><div class="tc">网站名称</div></th>
                        <th><div class="tl" style="padding-left: 10px;">链接地址</div></th>
                        <th class="w100"><div class="tc">新窗口</div></th>
                        <th class="w160"><div class="tc">更新时间</div></th>
                        <th class="w120"><div class="tc">操作</div></th>
                        <th class="w60"><div class="tc">排序</div></th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        
        <!-- 数据内容 -->
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                    {empty name="list"}
                        <tr>
                            <td class="no-data" align="center" axis="col0" colspan="50">
                                <div class="no_row">
                                    <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
                                </div>
                            </td>
                        </tr>
                    {else/}
                        {volist name="list" id="vo"}
                        <tr>
                            <td class="sign">
                                <div class="w40 tc"><input type="checkbox" name="ids[]" value="{$vo.id}"></div>
                            </td>
                            <td class="sort">
                                <div class="w40 tc">{$vo.id}</div>
                            </td>
                            <td>
                                <div class="w250 tc">
                                    <a href="{:weapp_url('Monkmenu/Monkmenu/edit',array('id'=>$vo['id']))}">{$vo.title}</a>
                                </div>
                            </td>
                            <td style="width: 100%;">
                                <div class="tl" style="padding-left: 10px;">{$vo.url}</div>
                            </td>
                            <td>
                                <div class="w100 tc">
                                    {eq name="$vo['target']" value='1'}
                                        <span class="yes" onClick="changeTableVal('weapp_monkmenu','id','{$vo.id}','target',this);"><i class="fa fa-check-circle"></i>是</span>
                                    {else /}
                                        <span class="no" onClick="changeTableVal('weapp_monkmenu','id','{$vo.id}','target',this);"><i class="fa fa-ban"></i>否</span>
                                    {/eq}
                                </div>
                            </td>
                            <td>
                                <div class="w160 tc">{$vo.update_time|MyDate='Y-m-d H:i:s',###}</div>
                            </td>
                            <td class="operation">
                                <div class="w120 tc">
                                    <a href="{:weapp_url('Monkmenu/Monkmenu/edit',array('id'=>$vo['id']))}" class="btn blue">编辑</a>
                                    <i></i>
                                    <a class="btn red" href="javascript:void(0)" 
                                       data-url="{:weapp_url('Monkmenu/Monkmenu/del')}" 
                                       data-id="{$vo.id}" onClick="delfun(this);">删除</a>
                                </div>
                            </td>
                            <td class="sort">
                                <div class="w60 tc">
                                    <input type="text" size="4" value="{$vo.sort_order}" 
                                           onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'');"
                                           onchange="changeTableVal('weapp_monkmenu','id','{$vo.id}','sort_order',this);" />
                                </div>
                            </td>
                        </tr>
                        {/volist}
                    {/empty}
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        
        <!-- 底部操作栏 -->
        <div class="tDiv">
            <div class="tDiv2">
                <div class="fbutton checkboxall">
                    <input type="checkbox" autocomplete="off" class="checkAll">
                </div>
                <div class="fbutton">
                    <a onclick="batch_del(this, 'ids');" data-url="{:weapp_url('Monkmenu/Monkmenu/del')}">
                        <div class="add"><span>批量删除</span></div>
                    </a>
                </div>
                <div class="fbuttonr">
                    <div class="pages">{$pageStr}</div>
                </div>
                <div class="fbuttonr">
                    <div class="total">
                       <h5>共有{$pager->totalRows}条,每页显示
                            <select name="pagesize" style="width: 60px;" onchange="ey_selectPagesize(this);">
                                <option {if condition="$pager->listRows == 15"} selected {/if} value="15">15</option>
                                <option {if condition="$pager->listRows == 30"} selected {/if} value="30">30</option>
                                <option {if condition="$pager->listRows == 50"} selected {/if} value="50">50</option>
                                <option {if condition="$pager->listRows == 100"} selected {/if} value="100">100</option>
                                <option {if condition="$pager->listRows == 200"} selected {/if} value="200">200</option>
                            </select>
                       </h5>
                    </div>
                </div>
            </div>
            <div style="clear:both"></div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function(){
        $('input[name*=ids]').click(function(){
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked','checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function(){
            $('input[type=checkbox]').prop('checked',this.checked);
        });
    });
</script>
{include file="footer.htm" /}
